﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;

namespace TextTemplate
{
    /// <summary>
    /// This descendant of <see cref="Template{T}"/> adds back the API for the old-style template.
    /// </summary>
    public sealed class Template : Template<object>
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="Template"/> class.
        /// </summary>
        /// <remarks>
        /// See <see cref="Template{T}"/> for examples.
        /// </remarks>
        public Template()
            : base("templateState")
        {
            // Do nothing here
        }

        /// <summary>
        /// Executes the template, returning the generated text.
        /// </summary>
        /// <returns>
        /// The output generated by executing the template.
        /// </returns>
        /// <remarks>
        /// If the template has not yet been compiled, this will be done before
        /// execution, as part of the call to this method.
        /// </remarks>
        public string Execute()
        {
            return Execute(null);
        }
    }
}